﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.IO;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using HalconDotNet;
using Project1.Model;
using GalaSoft.MvvmLight.Messaging;

namespace Project1.View
{
    /// <summary>
    /// CoreView.xaml 的交互逻辑
    /// </summary>
    public partial class CoreView : Window
    {
        private ContextMenu cm;
        public CoreView()
        {
            InitializeComponent();
            
        }

        //AmplitudeThreshold := 40
        //RoiWidthLen2 := 5


        private void hWindowControlWPF1_HInitWindow(object sender, EventArgs e)
        {

        }

        private void hSmartWindowControlWPF1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            cm = this.FindResource("cmButton") as ContextMenu;
            cm.PlacementTarget = sender as Button;
            cm.IsOpen = true;
        }


        private void OnClearAllObjects_Click(object sender, RoutedEventArgs e)
        {
            Messenger.Default.Send<string>("clear", "Draw");
            //core.Matching();
        }
        private void OnRectangle1_Click(object sender, RoutedEventArgs e)
        {
            Messenger.Default.Send<string>("rectangle1", "Draw");
        }

        private void OnRectangle2_Click(object sender, RoutedEventArgs e)
        {
            Messenger.Default.Send<string>("rectangle2", "Draw");
        }

        private void OnCircle_Click(object sender, RoutedEventArgs e)
        {
            Messenger.Default.Send<string>("circle", "Draw");
        }

        private void OnEllipse_Click(object sender, RoutedEventArgs e)
        {
            Messenger.Default.Send<string>("ellipse", "Draw");
        }

        private void OnLine_Click(object sender, RoutedEventArgs e)
        {
            Messenger.Default.Send<string>("line", "Draw");
        }


      
    }
}
